package com.seatch.msauth.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("test")
@RefreshScope
public class TestController  {

    @NacosValue(value  = "${a.a}",autoRefreshed = true)
    private String val;

    @NacosValue(value  = "${test.a}",autoRefreshed = true)
    private String testAVal;

    @RequestMapping(value = "/get-val",method = RequestMethod.GET)
    @ResponseBody
    public String getVal()
    {
        return  "val => "+val + testAVal;
    }


}
